(function(){
    'use strict';
    angular.module('module.business')
        .controller('CreatePeopleController', CreatePeopleController);

    CreatePeopleController.$inject= ['$scope','$uibModalInstance'];

    function CreatePeopleController($scope,$uibModalInstance) {
        var vm = $scope;

        vm.ok = ok;                                     //点击'是'按钮时执行

        vm.cancel = cancel;                             //点击'否'按钮时执行

        vm.save = save; //保存测评人员

        return vm;



        /**
         * 保存测评人员信息
         */
        function save() {
            swal({
                title: '确认保存测评人员信息?',
                type: 'info',
                showCancelButton: true,
                confirmButtonColor: '#3085d6',
                cancelButtonColor: '#d33',
                confirmButtonText: '确认',
                cancelButtonText: '取消',
                confirmButtonClass: 'btn btn-success  margin-right-10',
                cancelButtonClass: 'btn btn-primary',
                buttonsStyling: false
            }).then(function () {
                swal({
                    title: '提示',
                    text: '保存成功',
                    closeOnConfirm: true,
                    type: 'success'
                }).then(function(){
                    cancel();
                });
            });
        }

        /**
         * @description 点击'是'按钮时执行
         */
        function ok() {
            $uibModalInstance.close(selected);
        }

        /**
         * @description 点击'否'按钮时执行
         */
        function cancel() {
            $uibModalInstance.dismiss('cancel');
        }
    }
})();